package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.DrillingB22f;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class DrillingB22fConverter implements AttributeConverter<DrillingB22f, String> {
    @Override
    public String convertToDatabaseColumn(DrillingB22f drillingB22f) {
        return JSONUtil.toJsonStr(drillingB22f);
    }

    @Override
    public DrillingB22f convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, DrillingB22f.class);
    }
}
